module.exports = (app) => {
    const { router, controller, middleware } = app;
    // 登录
    router.post('/login', controller.user.login)
    // 注册
    router.post('/register', controller.user.register)
    // 获取博客列表 get 获取  post 添加 put 编辑 delete 删除
    router.get('/blog/list', controller.blog.getBlog)
    // router.post('/blog/list', controller.blog.addBlog)
    // 文章点赞
    router.post('/blog/like', middleware.auth(), controller.blog.like)
    // 获取文章详情
    router.get('/blog/detail/:id', controller.blog.getDetail)
    // 评论
    router.post('/blog/comments', middleware.auth(), controller.blog.comment)
    // 获取当前文章的评论表
    router.get('/blog/comments', controller.blog.getComments)
}



// router => controller => service => core => ctx.body = xxx